package pers.gxm.builder;

/**
 *  将一些常见的build过程写在这里
 */
public class BookDirector {
    public static void main(String[] args) {
        BookDirector bookDirector = new BookDirector();
        Book book = bookDirector.construct();
        System.out.println("book = " + book);
    }
    private BookBuilder bookBuilder;

    public BookDirector(){
        bookBuilder = BookBuilder.aBook();
    }

    public Book construct(){
        System.out.println("构造对象前各种处理逻辑");
        Book book = bookBuilder.withBookJacket("书衣").withAuthor("作者").withPublisher("出版社").build();
        System.out.println("构造对象后各种处理逻辑");
        return book;
    }


}
